<div class="js_select_object">
<div class="brands_namez object_body">
<{if $info.left}>
<{foreach from=$info.left item=item}>
<div class="js_object_item" data_id="<{$item.self_id}>" data_tab="<{$item.self_tab}>" rel="select" <{if $item.self_tab!=$tab}>style="display:none;"<{/if}>><span><input type="checkbox" rel="chkbox"/></span><{t}><{$item.self_name}><{/t}></div>
<{/foreach}>
<{/if}>
</div>
</div>
<script>
(function(){
  var dialog = $('object_id_ipt').getParent('.dialog').retrieve('instance'),
      body = dialog.dialog;
  var info_body=$E('.js_select_object',info_body);
  var tab_abc=$E('.brands_abc',body);
  var Dataitem={
    format:function(){
      list = info_body.getElement('.object_body');
      this.bodySize(list);
      return this;
    },
    bodySize:function(sel){
      var el_size = sel.getSize();
			//if(el_size.y<el_size.scrollSize.y)
      this.search(sel);
			this.scroll();
		},
    search:function(sel){
      var obj_div = new Element('div',{'class':'brands_search'});
      
      var obj_input = new Element('input',{'autofocus':true,'name':'textfield','placeholder':'输入名称查找'}).inject(obj_div);
      obj_input.addEvents({
        'keyup':function(){
          var kwords=this.getValue().trim(),
            obj_li = tab_abc.getElement('li[class^=abc_on]');
          if(obj_li) current_tab = obj_li.getElement('a').get('text');
          if(!current_tab) current_tab = '';
          var soptions=sel.getElements('div[data_tab^='+current_tab+']');
					if(!kwords) return soptions.show();
					if(soptions)soptions.each(function(opt){
						opt[opt.get('text').test(kwords,'i')?'show':'hide']();
					});
        },
        'focus':function(){this.setStyle('color','#000');}
      });
      obj_div.inject(info_body,'top');
		},
		scroll:function(){
			info_body.retrieve('fxscroll',new Fx.Scroll(info_body.getParent(),{link:'cancel'})).toRight();
		}
	};
  Dataitem.format();
})();
</script>
